MC-10 Operation and Language Reference Manual Chapter 5

5/GETTING STARTED Have you read (and do you understand) the "Operation" section of this manual? Is your Computer hooked up, powered up, and ready to go? Is OK displayed on the TV? If you answered these questions with a "yes", you're ready to begin. OK is the MC-10's way of telling you that "everything is OK" and the Computer is waiting for you to do something. Whenever the OK prompt is displayed, you can type information into the Computer. If the OK prompt is not displayed, either a program is being processed or there is a malfunction somewhere in the system. Press the [BREAK] key to see if OK reappears. If a program was being run, the OK prompt will reappear. If there is a problem with the System, see Appendix D, "Troubleshooting and Maintenance", for a possible solution. Press [ENTER] a few times. The only thing that should happen is that the Cursor (that blinking block) will move down the left side of the Screen. [ENTER] serves the same purpose as the carriage return key on a normal typewriter. We call it the "enter" key, because you must press it before you "enter" any information into the Computer's memory. In other words, the MC-10 won't acknowledge anything you type in until you press [ENTER]. Once you press [ENTER], the MC-10 will either: Store or process the information you entered if it understands what you said or Display an error message if it didn't understand what you were trying to say. (See Appendix B for a complete list of Error Messages.) As an example, try typing in the following line exactly as it appears below (be sure OK is displayed): PRINT "HI, I'M THE MC-10" Now check the line. Is it exactly as above? Be sure to check the spelling of the word PRINT and the quotation marks, especially the first quote. If you made any mistakes, press the key-combination of [CONTROL][A] to "backspace" the Cursor and erase characters. Now press the [ENTER] key. Your Screen should display this: OK PRINT "HI, I'M THE MC-10" HI, I'M THE MC-10 OK Just like you told it, the MC-10 followed your instructions. You told it to "print" a specific message on the Screen and that's exactly what it did. For something different, type in this: PRINT 2 and press [ENTER]. This time your Screen should look like this: OK PRINT 2 2 OK Notice the difference. When you gave the MC-10 the instruction to "print" the number 2, you didn't include quotation marks around the number. Whether you realize it or not, you've just learned several things about Micro Color BASIC in this short example. For one thing, you've learned your first command-PRINT. An MC-10 command is just like any other command-you instruct the Computer to do something and you can expect the Computer to follow that instruction. PRINT is just one of many Micro Color BASIC commands that we'll be discussing in this section of the manual. The other thing you just learned is that there are only two types of information the MC-10 understands: String values which are anything that is enclosed in quotation marks (like "HI, I'M THE MC-10"). Numeric expressions which are numbers or variables which represent numbers (like the number 2). The Computer sees everything you type as either a String or a Numeric expression (number). If what you type is in quotes, it's a String and the MC-10 sees it and prints it exactly as it is. Try this: PRINT "********************" [ENTER] Just as an aside...The maximum number of characters that can be used at any one time is 127-that includes spaces and the [ENTER] key. In the case above, that means you could have 118 asterisks since the command PRINT, the quotation marks, the blank space before the first quote and pressing [ENTER] require 9 memory locations. If what you type in isn't in quotes, the Computer will treat it as a number by adding, subtracting, multiplying, or dividing it. The MC-10 as a Calculator Computers have traditionally been thought of as "number crunchers" and the MC-10 is no exception. With the PRINT command, you can use the MC-10 just like a calculator. Type in the following: PRINT 2 + 2 [ENTER] The Screen will look like this: PRINT 2 + 2 4 OK If you simply typed in 2+2, the MC-10 would go ahead and add the two numbers, but it wouldn't tell you the answer. Addition isn't the only math operation the MC-10 can perform. It can also subtract (use the [-] key), multiply (the [*] key), and divide (the [/] key). (The MC-10 has a full range of trigonometric functions-SIN,TAN,COS, etc.-that are discussed later in this manual.) Try these as examples: PRINT 10 - 5 [ENTER] 5 OK ? 10 * 10 [ENTER] 100 OK PRINT 100/10 [ENTER] 10 OK Error Messages By this time, the MC-10 has displayed an "error message"-especially if you misspelled the word PRINT. If you haven't seen an error message yet, type in the following line exactly as it is: PINT "THIS WILL CAUSE AN ERROR" [ENTER] Your TV will look like this: PINT "THIS WILL CAUSE AN ERROR" ?SN ERROR OK This is a "syntax" error and usually occurs when you make a typing mistake. An error message will also occur when you ask the MC-10 to do something that is illogical or impossible. For instance, type: PRINT 50/0 The TV will display: ?/0 ERROR which is a Division by Zero Error. (Everyone knows you can't divide by zero.) For a complete list of all error messages the MC-10 can produce, see Appendix B.

Comments should be directed to the following email address:
dsbrain@neosplice.com